﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace LiaisonDonnees
{
    public partial class Fm_menu : Form
    {
        private Donnees bd;
        public Fm_menu()
        {
            InitializeComponent();
            bd = new Donnees();
            try
            {
                bd.Charger();
            }
            catch
            {
                MessageBox.Show("Données non chargées, fichier non existant ou incorrect !", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void btn_services_Click(object sender, EventArgs e)
        {
            Fm_service fsce = new Fm_service(bd);
            fsce.ShowDialog();
        }
        private void btn_diplomes_Click(object sender, EventArgs e)
        {
            Fm_diplome fdme = new Fm_diplome(bd);
            fdme.ShowDialog();
        }
        private void btn_employes_Click(object sender, EventArgs e)
        {
            Fm_employe feye = new Fm_employe(bd);
            feye.ShowDialog();
        }
        private void btn_grilleEmployés_Click(object sender, EventArgs e)
        {
            Fm_employeGrille fele = new Fm_employeGrille(bd);
            fele.ShowDialog();
        }
        private void btn_service_Employe_Click(object sender, EventArgs e)
        {
            Fm_serviceEmploye fsye = new Fm_serviceEmploye(bd);
            fsye.ShowDialog();
        }
        private void Fm_menu_FormClosing(object sender, FormClosingEventArgs e)
        {
            bd.Sauver();
        }
    }
}
